package web

import (
	"MsSgServer/db"
	"MsSgServer/server/web/controller"
	"MsSgServer/server/web/middleware"
	"github.com/gin-gonic/gin"
)

func Init(router *gin.Engine) {
	// 测试数据库 并且初始化
	db.TestDB()
	// 初始化路由
	initRouter(router)
}

func initRouter(router *gin.Engine) {
	// 跨域问题
	router.Use(middleware.Cors())
	// 路由设置
	router.Any("/account/register", controller.DefaultAccountController.Register)
}
